#include<bits/stdc++.h>
using namespace std;
const int NN=1e7+4,P=998244353;
int fac[NN],ifac[NN],pn[NN],w[NN];
int qmi(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b&1)
            res=1ll*res*a%P;
        a=1ll*a*a%P;
        b>>=1;
    }
    return res;
}
int main()
{
    freopen("length.in","r",stdin);
    freopen("length.out","w",stdout);
    int n,k;
    scanf("%d%d",&n,&k);
    fac[0]=pn[0]=1;
    for(int i=1;i<=n;i++)
    {
        fac[i]=1ll*fac[i-1]*i%P;
        pn[i]=1ll*pn[i-1]*n%P;
    }
    ifac[n]=qmi(fac[n],P-2);
    for(int i=n-1;~i;i--)
        ifac[i]=1ll*ifac[i+1]*(i+1)%P;
    w[1]=1,w[2]=qmi(2,k);
    for(int i=3;i<=n;i++)
        if(!(i%2))
            w[i]=1ll*w[i/2]*w[2]%P;
        else
            w[i]=qmi(i,k);
    int ans=0;
    for(int i=1;i<=n;i++)
        ans=(ans+1ll*w[i]*fac[n]%P*ifac[n-i]%P*ifac[i]%P*fac[i-1]%P*pn[n-i]%P)%P;
    printf("%d",ans);
    return 0;
}